<template>
    <div>
        <p>[1,2,3,4,5,6]</p>
        <hr>
        <button @click="remove">删除数组中的指定元素</button>
    </div>
</template>

<script>
export default {
    methods: {
        remove(){
            let arr = [1,2,3,4,5,6];

            arr.forEach((e, i) => {
                if(e == 3){
                    arr.splice(i, 1)
                }
            })

            console.log(arr)
        }
    }
}
</script>
